<template>
	<view class="myInfo">
		<view class="info_picture">
			<image src="../../static/images/user.webp" mode=""></image>
		</view>
		<view class="info_detail">
			<view class="info_item">
				<text class="item_name">昵称</text>
				<input type="text" :placeholder="token?.nickname" disabled />
			</view>
			<view class="info_item">
				<text class="item_name">用户名</text>
				<input type="text" :placeholder="token?.username" disabled />
			</view>
			<view class="info_item">
				<text class="item_name">邮箱</text>
				<input type="text" :placeholder="token?.email" disabled />
			</view>
			<view class="info_item">
				<text class="item_name">电话</text>
				<input type="text" :placeholder="token?.username" disabled />
			</view>
			<view class="info_item" @click="goAuthentication">
				<text class="item_name">实人认证</text>
				<input type="text" placeholder="未认证" disabled />
			</view>
			<view class="info_item" @click="goAddress">
				<text class="item_name">详细地址</text>
				<input type="text" placeholder="暂无" disabled />
			</view>
		</view>
	</view>
</template>

<script setup>
import { onMounted, ref } from 'vue';
import { useMyStore } from '@/stores/myStore.js';
const store = useMyStore();
let token = ref();
const share = () => {
	uni.share({
		provider: 'weixin',
		scene: 'WXSceneSession',
		type: 1,
		summary: '我正在使用HBuilderX开发uni-app，赶紧跟我一起来体验！',
		success: function (res) {
			console.log('success:' + JSON.stringify(res));
		},
		fail: function (err) {
			console.log('fail:' + JSON.stringify(err));
		}
	});
};
onMounted(() => {
	store.getLogin();
	token.value = uni.getStorageSync('token');
});
const goAuthentication = () => {
	uni.navigateTo({
		url: '/pages/authentication/authentication'
	});
};
const goAddress = () => {
	uni.navigateTo({
		url: '/pages/myAddress/myAddress'
	});
};
</script>

<style lang="scss">
.myInfo {
	width: 100%;
	height: 100vh;
	background-color: #fff;
	box-sizing: border-box;
	padding: 0 30rpx;
	.info_picture {
		height: 40%;
		display: flex;
		align-items: center;
		justify-content: center;
		image {
			width: 50%;
			height: 60%;
			border-radius: 50%;
		}
	}
	.info_detail {
		height: 60%;
		display: flex;
		flex-direction: column;
		.info_item {
			width: 100%;
			height: 80rpx;
			display: flex;
			align-items: center;
			margin: 30rpx 0;
			text {
				width: 200rpx;
				letter-spacing: 10rpx;
			}
			input {
				width: 70%;
				height: 100%;
				border-bottom: 2rpx solid #f2f2f2;
			}
		}
	}
}
</style>
